
function play(soundFX) //plays full track on whatever element ID you pass
  { 
   if(nothal.soundENABLE){
      var myAudio2=document.getElementById(soundFX); 
      myAudio2.play(); 
    }
  } 
  
function playLoop( audioTag ) //sends in file to be looped
  {
    if( nothal.soundENABLE ) {
    //myAudio=document.getElementById("backgroundMusic"); 
      //myAudio.setAttribute("src",audioFile);
      ////myAudio.load();
      //myAudio.volume = 1;
      //myAudio.play(); 
      audioTag.volume = 1;
      audioTag.play();
      nothal.playing.push( audioTag );
   }
  } 

function pauseLoop()
  { 
		nothal.I = setInterval(function(){myAudio.volume = myAudio.volume-myAudio.volume/5;},500); //Whats the proper timing for fade??
    setTimeout(function(){clearInterval(nothal.I); myAudio.pause(); },2000);
  
  } 

function playMusic( nothal, audioTag ) {
	//console.log("playMusic");
	if( nothal.soundENABLE ) {
		//console.log("playing music");
		if( 'undefined' != typeof nothal.music ) { nothal.music.pause(); }
		if( 'undefined' != typeof audioTag ) { nothal.music = audioTag; }
		if( 'undefined' != typeof nothal.music ) {
			nothal.music.volume = 1;
			nothal.music.play();
		}
	}
}

function pauseMusic( nothal ) {
	//console.log("pauseMusic");
	if( 'undefined' != typeof nothal.music ) {
		//console.log("pausing music");
		nothal.music.pause();
	}
}
